{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=27
  Verdict: Accepted
}
uses
	SysUtils, Math; 
 
var
	a,b,kk,g:longint;
 
procedure swap(var a,b:longint);
 
var
	t:longint;
 
begin
t:=a;
a:=b;
b:=t;
end;
 
function gcd(a,b:longint):longint;
begin
if a<b then swap(a,b);
while b > 0 do begin
	a:=a mod b;
	swap(a,b);
end;
result:=a;
end;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(a,b);
kk := sign(a);
a:=abs(a);
g:=gcd(a,b);
write((a div g)*kk,' ',b div g);
end.